// app.js
const app=getApp()
App({
  onLaunch() {
    wx.cloud.init({
      env: 'cloud-0gcgpg1s3be0f7e5',
      traceUser: true
     }),
     this.getOpenid()

  },
  globalData: {
    userInfo: null,
    userOpenid:null,
  },
  getOpenid(){
      var that=this
        wx.cloud.callFunction({
        name: 'getOpenid',
        complete: res => {
          console.log('用户OpenId为：', res.result.OPENID)
          that.globalData.userOpenid=res.result.OPENID
          wx.setStorageSync('openid',res.result.OPENID)
        }
      })},
      
})
